// pages/store/store.js
const app = getApp();
Page({
  data: {
    goods_list: [],
    current_detail_list: [],
    types : 9,
    num:0
  },
  goodsurl: function (e) {
    var gid   = e.currentTarget.dataset.gid;
    var bid   = e.currentTarget.dataset.bid;
    var types = e.currentTarget.dataset.types;
    wx.navigateTo({ url: '../goodsDetails/goodsDetails?gid=' + gid + '&types=' + types + '&bid=' + bid })
  },
  onLoad: function (options) {
    var that  = this;
    var types = options.types ;

    that.setData({ types: types});

    var bid   = options.bid;
    var tid   = options.tid;
    wx.request({
      url   : app.url+'/business/type_goods',
      data  : {
        uid   : wx.getStorageSync('uid'),
        bid   : bid,
        tid   : tid,
        types : types
      },
      method:'post',
      success:function(res){
        that.setData({
          goods_list:res.data.data,
          num: res.data.num
        })
      },
      error:function(){}
    })
  },
  onReady: function () {

  },
  onShow: function () {
   
  },
  onHide: function () {

  },
  onUnload: function () {

  },
  onPullDownRefresh: function () {

  },
  onReachBottom: function () {

  },
  onShareAppMessage: function () {

  }
})